//
//  SRBookCatalogueModel.m
//  StoryShow
//
//  Created by CyonLeuMBP on 2017/4/17.
//  Copyright © 2017年 qudiandu.cn. All rights reserved.
//

#import "SRBookCatalogueModel.h"

@implementation SRBookCatalogueModel

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
    NSMutableDictionary *dict = [[super JSONKeyPathsByPropertyKey] mutableCopy];
    
    NSDictionary *addDict =  @{
                               @"catalogue_id": @"catalogue_id",
                               @"unit": @"unit",
                               @"duration": @"duration",
                               @"title": @"title",
                               
                               @"page": @"page",
                               @"mp3name": @"mp3name",
                               @"mp3url": @"mp3url",
                               @"book_id": @"book_id",
                               @"page_url": @"page_url",
                               @"clickread": @"clickread",
                               @"page_id": @"page_id"
                               };
    [dict addEntriesFromDictionary:addDict];
    
    return dict;
}

- (NSString *)firstPageID {
    NSArray *pageIDs = [self.page_id componentsSeparatedByString:@","];
    if (pageIDs && [pageIDs count] > 0) {
        return [pageIDs firstObject];
    }
    
    return nil;
}

@end
